<?php include(BASE_PATH . "/view/layout/layoutP.phtml"); ?>
<style>
	body{background: #fafafa;}
    .regContent{
        width: 100%;
        height: auto;
        background: #fafafa;
        padding: 20px;
    }
    .regContainer{
    	width: 950px;
        box-shadow: 0px -2px 8px -1px rgba(0,0,0,0.3);
        height: auto;
    	overflow: hidden;
    	margin:0 auto;
    	margin-bottom: 50px;
    	margin-top: 50px;
    }
    .regContainer .dspan{
    	line-height: 42px;
	    border-top: 4px solid #ea3a3a;
		display: inline-block;
		width: 100%;
	    font-size: 16px;
	    padding-left: 20px;
	    position: relative;
    }
    .regInputCont{height: 70px;}
    .regInputCont label{font-weight: normal;font-size: 16px;width: 100px;text-align: right;margin-left: 20px;}
    .regInputCont input{
    	margin-left: 15px;
        padding-left: 10px;
        height: 30px;
        width: 285px;
        border: 1px solid #cdcdcd;
        border-radius: 3px;
    }
    .reg_form{
		padding-top: 50px;
        padding-bottom: 50px;
        background-color: white;
    }
    .reg_tab .icon-c{
    	color: #ea3a3a;
    	font-weight: bold;
    }
    .regBtn{
    	width: 285px;
	    height: 38px;
	    margin-left: 138px;
	    background-color: #e83535;
	    border: 1px solid #e83535;
	    background-image: -webkit-linear-gradient(top,#ed3f3f,#e83535);
	    color: #fff;
	    border-radius: 5px;
	    letter-spacing: 3px;
	    margin-bottom: 20px;
    }
    .regBtn:hover{
    	background: #FE6262;
        background-image: -webkit-linear-gradient(top,#ff6868,#f95454);
    }
    .reg_p_a a{
		padding-left: 138px;
    }
    .reg_left{
    	width: 520px;
    	float: left;
    }
	.regRight_tab{border-top: 4px solid #ea3a3a;height: 47px;}
	.regRightText{
		background: white;
		padding-top: 30px;
        width: 430px;
        height: 457px;
    	float: left;
	}
	.memberServices dd {
	    height: 80px;
	    line-height: 80px;
	    padding-left: 60px;
	    background: url(/img/reg/services_icon.png) 0 0 no-repeat;
	}
	.memberServices dt {
	    color: #999;
	    margin-bottom: 20px;
	    font-weight: normal;
	}
	.memberServices dd.services_ico1 {
	    background-position: -10px 0;
	}
	.memberServices dd.services_ico2 {
	    background-position: -10px -80px;
	}
	.memberServices dd.services_ico3 {
	   background-position: -10px -160px;
	}
	.memberServices dd.services_ico4 {
	   background-position: -10px -240px;
	}
    #form .help-block{
        color: #FE6262;
        font-size: 12px;
        padding-left: 139px;
    }
</style>
<div class="regContent">
    <div class="regContainer clearfix">
    	<div class="reg_left" id="reg_form"> 
			<div class="reg_tab">
				<span  class="dspan">
					<i class="iconfont icon-c">&#xe614;</i>
					个人用户注册
				</span>
			</div>
			<div class="reg_form">
                <form id="form">
                    <div class="regInputCont">
                        <label>用户名:</label>
                        <input type="text" name="userName" id="userName" placeholder="请输入用户名">
                    </div>
                    <div class="regInputCont">
                        <label>密码:</label>
                        <input type="password" name="password" id="password" placeholder="6-16位数字或英文字母">
                    </div>
                    <div class="regInputCont">
                        <label>确认密码:</label>
                        <input type="password" name="repassword" id="repassword" placeholder="6-16位数字或英文字母">
                    </div>
                    <div class="regInputCont">
                        <label>绑定邮箱:</label>
                        <input type="email" name="email" id="email" placeholder="请输入需要绑定的邮箱">
                    </div>
                    <div class="regBtnCont">
                        <button type="button" class="regBtn">注册</button>
                        <p class="reg_p_a">
                            <a href="/application/login/index">已有账号，直接登录</a>
                        </p>
                    </div>
                </form>
			</div>
		</div>
		<div class="reg_right">
			<div class="regRight_tab">

			</div>
			<div class="regRightText">
				<dl class="memberServices">
					<dt>注册成为我的物流会员，您可以享受更多的服务！</dt>
					<dd class="services_ico1">积分奖励，电子运单专享特权</dd>
					<dd class="services_ico2">快速理赔、保价优惠</dd>
					<dd class="services_ico3">大陆偏远地区附加费减免</dd>
					<dd class="services_ico4">快件路由订阅、快件信息管理、批量下单</dd>
				</dl>

			</div>
		</div>
    </div>
</div>
<script type="text/javascript" src="/js/form/jquery.validate.min.js"></script>
<script type="text/javascript" src="/js/form/registerform.js"></script>
<script type="text/javascript">
$(function(){
    registerValidator.init();
    regSave.init();
})

var regSave = {
	init:function(){
        this.commitEvent();
	},
	commitEvent:function(){
		$(".regBtn").click(function(){
            if(!$('#form').valid()){
                return;
            }
			var userName = $("#userName").val();
			var password = $("#password").val();
			var email    = $("#email").val();
			$.ajax({
				type:"POST",
				url:"/application/reg/save",
				datatype:"JSON",
				data:{"userName":userName,"password":password,"email":email},
				success:function(ret){
                    ret = JSON.parse(ret);
                    if(ret.result == 0){
                        var callback =function(){
                            window.location.reload();
                        }
                        popupalert("注册成功！","message",callback)
                    }
				},
				error:function(e){
                    var callback =function(){
                        window.location.reload();
                    }
                    popupalert("注册失败！","error",callback)
				}
			})
		})
	},
}


</script>
<?php include(BASE_PATH . "/view/layout/footer.phtml"); ?>

